﻿package mortal.game.scene3D.ai.base
{
    import mortal.game.scene3D.ai.data.*;

    public class AICommand extends Object implements IAICommand
    {
        protected var _callback:Function;
        protected var _data:AIData;

        public function AICommand()
        {
            return;
        }// end function

        public function set callback(param1:Function) : void
        {
            this._callback = param1;
            return;
        }// end function

        public function set data(param1:AIData) : void
        {
            this._data = param1;
            return;
        }// end function

        public function get data() : AIData
        {
            return this._data;
        }// end function

        public function start(param1:Function = null) : void
        {
            this._callback = param1;
            return;
        }// end function

        public function stop(param1:Boolean = true) : void
        {
            this.endAI();
            return;
        }// end function

        public function get stopable() : Boolean
        {
            return true;
        }// end function

        public function endAI() : void
        {
            if (this._callback != null)
            {
                this._callback.apply();
            }
            this._callback = null;
            return;
        }// end function

    }
}
